package Book;
//书的属性
public class Book {
    //书名
    private String bookName;
    //作者
    private String author;
    //价钱
    private int price;
    //类型
    private String type;
    //是否被借出
    private boolean isLend;

    public Book(String bookName, String author, int price, String type) {
        this.bookName = bookName;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getBookName() {
        return bookName;
    }
    public void setBookName(String bookName) {
        this.bookName = bookName;
    }
    public String getAuthor() {
        return author;
    }
    public void setAuthor(String author) {
        this.author = author;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }

    public void setLend(boolean lend) {
        isLend = lend;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ",author='" + author + '\'' +
                ",price="+ price +
                ",type='" + type + '\'' +
                ",isLend="
        +(isLend == true ? "已被借出":"未被借出")+
                '}';
    }
}
